home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MacGofer 0.22d / MacGofer Sources / Readme < prev    next >
Encoding:
Text File  |  1994-01-06  |  21.4 KB  |  314 lines  |  [TEXT/MPS ]

  1. ions:
  2.  
  3. Set #define SUNOS 1 and the rest to 0 in prelude.h.  Edit the Makefile
  4. as necessary.  I tried this on a Sun 4 using gcc, but I think it should
  5. also work on Sun 3, and with cc ...  If your site has both Sun3 and
  6. Sun4 machines, the following script may be of use:
  7.  
  8.     #!/bin/sh
  9.  
  10.     GOFER=/usr/local/lib/Gofer/prelude
  11.     export GOFER
  12.  
  13.     if (sparc) then
  14.         exec /usr/local/lib/Gofer/gofer4 $*
  15.     elif (m68k) then
  16.         exec /usr/local/lib/Gofer/gofer3 $*
  17.     else
  18.         echo I dont know how to start Gofer on your machine
  19.     fi
  20.  
  21.  
  22. ---------------------
  23. IBM OS/2 2.0 using EMX GCC:
  24.  
  25. Set #define OS2 1 and the rest to 0 in prelude.h.  Thanks to
  26. Bryan Scattergood for sending the patches to get this working!
  27.  
  28.  
  29. ---------------------
  30. System V release 4 using GCC2.2:
  31.  
  32. Set #define SVR4 1 and the rest to 0 in prelude.h.  Thanks to
  33. Bryan Scattergood for sending the patches to get this working!
  34.  
  35.  
  36. ---------------------
  37. SCO Unix 3.2.4:
  38.  
  39. Set #define SVR4 1 and the rest to 0 in prelude.h.  Compile using gcc 2.2.2.
  40. Thanks to Rodney Brown!
  41.  
  42.  
  43. ---------------------
  44. Silicon Graphics with Irix:
  45.  
  46. Set #define SVR4 1 and the rest to 0 in prelude.h.  Set the makefile to
  47. use cc.  If you are running on a machine with a MIPS R4000 CPU, you might
  48. also like to add -mips2 to CFLAGS (this should not be used if you want
  49. backward compatibility with machines based on the MIPS R3000 CPU).
  50.  
  51. I think you can probably build Gofer using gcc but I haven't had the
  52. opportunity to try that myself.
  53.  
  54.  
  55. ---------------------
  56. HP systems:
  57.  
  58. Set #define HPUX 1 and the rest to 0 in prelude.h.  I've had patches
  59. for HP machines from a number of people including Tom Lane, Dipankar
  60. Gupta, Rodney Brown and Jeroen Fokker and I've tried to work these into
  61. the source for 2.28.  There were occasional discrepancies between the
  62. sets of patches that I received so I sometimes had to take a `majority
  63. vote'; perhaps they were for slightly different machines?  Anyway, I
  64. hope that Gofer will compile on HP machines using these settings -- or
  65. at least be easy to patch to make it run correctly if not.  Thanks for
  66. the patches everyone!
  67.  
  68. It has now been verified that the HPUX patch version will at least
  69. compile correctly on HP series 400 workstations (68040 CPU) running
  70. HP-UX 8.0 with gcc, thanks to Kurt Olender!
  71.  
  72. Gofer 2.28 has also been built on an H.P. Series 700 machine running
  73. HP-UX 8.07.  Gofer does not work if it is compiled using gcc (2.3.3).
  74. Use the HP C compiler (cc) in ANSI mode.   A guide to setting the
  75. macro definitions in the Makefile:
  76.  
  77.     CC        = cc
  78.     CFLAGS    = -Aa -D_HPUX_SOURCE 
  79.     LDFLAGS   = -lm
  80.     OPTFLAGS  = +O3
  81.     OPT1      = +O1
  82.  
  83. Thanks to Dave Sherratt for this information!
  84.  
  85.  
  86. ---------------------
  87. DECstation 5000 running Ultrix 4.2 (MIPS R3000 CPU) with GCC2.3.3:
  88.  
  89. Set #define ULTRIX 1 and the rest to 0 in prelude.h.  Thanks to Kurt Olender
  90. for the patches!
  91.  
  92. This release of Gofer includes a slight modification, brought to my notice
  93. by Jerry Prothero, which should also make it possible to compile Gofer using
  94. DEC's own cc compiler instead of gcc.  Thanks Jerry!
  95.  
  96.  
  97. ---------------------
  98. IBM AIX on RS/6000 using GCC:
  99.  
  100. Set #define AIX 1 and the rest to 0 in prelude.h.  Thanks (again) to Kurt
  101. Olender for the patches!
  102.  
  103.  
  104. ---------------------
  105. Minix 68K:
  106.  
  107. Set #define MINIX68K 1 and the rest to 0 in prelude.h.  Rainer Orth
  108. sent me sent me some patches to make Gofer 2.23 compile and run under
  109. Minix 68k using the GNU C compiler, I believe.  I have tried to make
  110. the same changes to the latest version, but I have not verified that
  111. they work.  Some small changes may be needed -- please let me know if
  112. you try it.  Thanks Rainer!
  113.  
  114.  
  115. ---------------------
  116. Linux with gcc:
  117.  
  118. Set #define LINUX 1 and the rest to 0 in prelude.h.  Ray Bellis sent me
  119. some patches to make Gofer 2.23 compile and run under Linux using the
  120. GNU C compiler.  I have tried to make the same changes to the latest
  121. version, but I have not verified that they work.  Some small changes
  122. may be needed -- please let me know if you try it.  And thanks, Ray!
  123.  
  124. Since 2.28 was first distributed I've had feedback from two people
  125. that have compiled Gofer to run on Linux.  Bambang Prastowo wrote
  126. to let me know that Gofer compiled without modifications (other
  127. than setting #define LINUX 1).  Eak Khoon reported that it was
  128. neccessary to comment out the #define const at the beginning of
  129. prelude.h and change prototypes in prelude.h to:
  130.    extern *getenv Args((const char *));
  131.    extern system  Args((const char *));
  132.    extern atof    Args((const char *));
  133. This may be due to the use of slightly different compilers or versions
  134. of Linux.  In any case, it should be fairly straightforward to build
  135. Gofer to run under Linux.
  136.  
  137. ---------------------
  138. Acorn DesktopC and RISCOS2 or 3:
  139.  
  140. Set #define RISCOS 1  and the rest to 0 in prelude.h.  Use the file
  141. AcornMake to build the Gofer system.  Thanks to Bryan Scattergood for
  142. the patches to make Gofer compile and run under RISCOS!
  143.  
  144.  
  145. ---------------------
  146. Amiga:
  147.  
  148. Set #define AMIGA 1  and the rest to 0 in prelude.h.  Compile using
  149. gcc 2.2.2.  Thanks to Luc and Mark Duponcheel for their help in
  150. getting this to work.  One small problem remains that ^C interrupts
  151. do not currently work.  I believe this can be solved by setting an
  152. appropriate value for the #define allowBreak() macro in prelude.h,
  153. but I am not sure what definition should be used.  Frederek Althoff
  154. has investigated this problem and believes that there may be a problem
  155. with the signal handling in the current version of gcc on the Amiga.
  156. Frederek has written a C program, included in the main distribution
  157. as amigaint.c, to try and help out.  In his words: `` All you have
  158. to do is start the program from an other shell with the process-id
  159. of gofer. To get this id, you have to use a program called "Status"
  160. (similar to "ps"). That's all. You might add this program to your
  161. distribution? This will `help' until the ^C-problem is fixed''.
  162. Thanks Frederek!
  163.  
  164.  
  165. ---------------------
  166. DEC Alpha with OSF/1:
  167.  
  168. Set #define ALPHA 1 and the rest to 0 in prelude.h.  Briefly, I tried
  169. compiling Gofer on a 64 bit DEC Alpha with a preliminary version of
  170. OSF/1.  I didn't spend long, but it seems that it is probably safest to
  171. compile without using any optimization.  Furthermore, only the
  172. interpreter can be used at the current time and integers are restricted
  173. to 32 bit quantities.  I may do something to change this one day, but
  174. it is not a high priority.  Essentially, what needs to be done is to
  175. redefine the Int type as a synonym (i.e.  typedef) for long and to
  176. replace all appropriate uses of %d in prinf strings with %ld.
  177.  
  178.  
  179. ---------------------
  180. MIPS RC6280(BSDenvironment on OS2.2):
  181. SONY machine(NWS-3870, BSD4.3- based OS NEWS OS4.2R, Mips-made risk chip):
  182.  
  183. Set #define MIPS 1 and the rest to 0 in prelude.h.  The patches for this
  184. version of Gofer were sent to me by Hiroyuki Matsuda ... thanks!  I only
  185. hope that I have correctly incorporated them into the main distribution!
  186.  
  187.  
  188. ---------------------
  189. 386bsd:
  190.  
  191. A 386bsd version of Gofer has been put together by Viren Shah.  It sounds
  192. like a rather complicated process, so I'll just quote the instructions that
  193. Viren sent me ... I haven't tried this myself:
  194.  
  195. | I used the SUNOS mode (i did try the linux mode, but that crashed
  196. | repeatedly and no amount of hacking could fix it) and the following
  197. | are the changes made by me in order to install it:
  198. | 1.> Copied malloc.h from /usr/include/g++ to current directory, namely
  199. | /usr/local/Gofer/src .
  200. | 2.> edited Makefile :
  201. |     CFLAGS : -I. -I/usr/src/sys.386bsd/sys -I/usr/include/g++
  202. | 3.> edited gofc.c to comment out #include <sys/stat.h>
  203. | 4.> copied time.h from /usr/src/include to current directory
  204. | 5.> edited Makefile :
  205. |     for .gs files the compile command is now :
  206. |      $(CC) $(CFLAGS) $(OPTFLAGS) $*.c runtime.o -o $* $(LDFLAGS)    
  207. | 6.> edited goferc script to include the -I option for the gcc compiler
  208. | Most of the above changes (not that they are very many) are probably
  209. | due to system specific problems, but I have no way of determining
  210. | that since I do not know anyone else installing Gofer on 386bsd.
  211.  
  212.  
  213. ---------------------
  214. OTHER PLATFORMS:
  215.  
  216. Gofer has been tested on other platforms and most of the code is fairly
  217. standard.  The code does however make certain assumptions about the system
  218. on which Gofer will be used.  These are summarised below as an aid
  219. to those interested in porting Gofer to other systems:
  220.  
  221. 1) For the benefit of Garbage collection from the C stack, all function
  222.    parameters and local variables are expected to have sizes which are
  223.    a multiple of sizeof(Int) (defined in prelude.h).  In other words,
  224.    you should check that:
  225.  
  226.              sizeof(FloatImpType) % sizeof(Int) == 0
  227.              sizeof(String)       % sizeof(Int) == 0
  228.              sizeof(Char)         % sizeof(Int) == 0
  229.              sizeof(Long)         % sizeof(Int) == 0
  230.              sizeof(Unsigned)     % sizeof(Int) == 0
  231.  
  232.    (These types are defined in prelude.h and storage.h)
  233.  
  234. 2) Study the comments and settings in prelude.h in order to find out how
  235.    other ports of Gofer have been produced.
  236.  
  237. 3) The words local and far are used to access non-standard extensions
  238.    in Turbo C to allow the Gofer system to overcome some of the
  239.    limitations of the PC's segmented architecture.  These should be
  240.    #defined to empty strings on most other machines with a flat address
  241.    space.
  242.  
  243. 4) The current version of the garbage collector in the Gofer interpreter
  244.    uses the C call stack as an array of Cell values to find temporary
  245.    variables that point into the heap.  This is a well-known technique
  246.    often described as `conservative garbage collection' but the
  247.    implementation in C is inherently non-portable.  Surprisingly enough
  248.    though, for almost all of the machines supported, you can make some
  249.    simple assumptions and get things to work quite nicely.  The RISCOS
  250.    code is one example where things are very different.  But for the most
  251.    part, you can treat the C stack as an array of Cell values.  As the
  252.    program runs the size of the stack changes and you need to know the
  253.    extent of the array.  The first element pushed onto the stack is
  254.    pretty much fixed, so it is the position of the stack pointer that
  255.    determines how big the stack is.
  256.  
  257.    On many machines, the stack grows downwards.  I have yet to come across
  258.    a machine where the stack grows upwards, but I have heard that this
  259.    happens on some HP systems.
  260.  
  261.    Here is the way to deal with this in the current version of the code.
  262.    In machdep.c, you will find a function gcCStack() which traverses the
  263.    stack.  To make things easier, there are three macros:
  264.  
  265.       #define StackGrowsDown  ...
  266.       #define StackGrowsUp    ...
  267.       #define GuessDirection  ...
  268.  
  269.    The first two describe the way to mark the stack on a machine in which the
  270.    stack grows either up or down respectively.  The third tries to guess
  271.    which way to do things by comparing two pointers.  Strictly speaking,
  272.    this comparison probably doesn't fall under the definition of standard C
  273.    so it may not be portable.  The current usage of these functions is as
  274.    follows:
  275.  
  276.        #if HPUX
  277.            GuessDirection;
  278.        #else
  279.            StackGrowsDown;
  280.        #endif
  281.  
  282.     Change as necessary to suit your machine (and please let me know so that
  283.     I can update the source).
  284.  
  285. Almost all of the machine dependencies in the code for Gofer are contained
  286. in the header file "prelude.h", and the program file "machdep.c".  These
  287. files contain definitions for both the TURBOC and UNIX versions described
  288. above and should be a useful guide.
  289.  
  290. I regret that I do not have time to write more substantial notes for
  291. porting Gofer at the present time.  I will however be happy to offer
  292. advice and answer other questions if you want to contact me in person
  293. at the email address below.  If you do successfully complete a port for
  294. another machine, please let me know what changes are necessary.  I know
  295. that it isn't always possible, but if you can, please try to restrict
  296. changes to the prelude.h and machdep.c files.
  297.  
  298. ---------------------
  299.  
  300. NOTE: if Gofer starts behaving unexpectedly, try recompiling
  301. without full compiler optimisation and see if the problem still occurs.
  302. If so, please get in touch with me, giving me as much information about
  303. the problem as possible, and I'll try and sort it out for you.  If you
  304. find a bug which you fix yourself, please send me details so that I can
  305. pass the fix onto to other users of Gofer.
  306.  
  307. If gofc starts behaving unexpectedly, try running the same code through
  308. the interpreter.
  309.  
  310. jones-mark@cs.yale.edu
  311. -------------------------------------------------------------------------------
  312.